﻿using Rechargeable.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Localization;

namespace Rechargeable.Permissions
{
    public class RechargeablePermissionDefinitionProvider : PermissionDefinitionProvider
    {
        public override void Define(IPermissionDefinitionContext context)
        {
            var group = context.AddGroup(RechargeablePermissions.GroupName,L("Rechargeable"));

            //Define your own permissions here. Example:
            //myGroup.AddPermission(RechargeablePermissions.MyPermission1, L("Permission:MyPermission1"));
            group.AddPermission(RechargeablePermissions.ShowAllMachine, L("Permission:ShowAllMachine"));
            group.AddPermission(RechargeablePermissions.SerialNumber, L("Permission:SerialNumber"));
            group.AddPermission(RechargeablePermissions.Machines, L("Permission:Machines"));
            group.AddPermission(RechargeablePermissions.Product, L("Permission:Products"));
        }

        private static LocalizableString L(string name)
        {
            return LocalizableString.Create<RechargeableResource>(name);
        }
    }
}
